export function convertListToMap(list, k = "value", v = "label") {
  const map = {};
  for (const item of list) {
    map[item[k]] = item[v];
  }
  return map;
}

export function parseTime(time, cFormat) {
  const nowTime = new Date().getTime();
  const pastTime = new Date(time).getTime();
  const expirationTime = pastTime - nowTime;
  var month = String(
    parseInt((expirationTime / 1000 / 60 / 60 / 24 / 30) % 12)
  ); //月
  const arr = month.split("");
  if (arr[0] === "-") {
    arr.shift();
    console.log(arr);
    return `过期${arr.join("") + "月"}`;
  } else {
    return `在保${arr.join("") + "月"}`;
  }
}
